import Vue from 'vue'
import Vuex from 'vuex'
import actions from './actions'
import mutations from './mutations'
import getters from './getters'

Vue.use(Vuex)

const state = {
  cartItems: [
    { id: 1, name: '手机', price: 1000, quantity: 1 },
    { id: 2, name: '电脑', price: 2000, quantity: 1 },
    { id: 3, name: '键盘', price: 200, quantity: 2 }
  ]
}

export default new Vuex.Store({
  state,
  mutations,
  actions,
  getters
})